import { getItem, setItem } from './storage';

/**
 * 获取时间戳
 * @returns {string} token
 */
export function getTimeStamp() {
  return getItem('TIME_STAMP');
}

/**
 * 设置时间戳
 * @param {string} timeStamp
 */
export function setTimeStamp() {
  setItem('TIME_STAMP', Date.now());
}

/**
 * 是否超时
 */
export function isCheckTimeout() {
  const currentTime = Date.now();
  const timeStamp = getTimeStamp();
  return currentTime - timeStamp > 2 * 3600 * 1000;
}
